package cn.edu.hitwh.kanlema.config;

import cn.hutool.core.lang.Snowflake;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class SnowflakeConfig {
    @Bean
    public Snowflake snowflake(InstanceConfig instanceConfig) {
        return new Snowflake(instanceConfig.getId(), instanceConfig.getDataCenterId());
    }
}
